const OtherSynUrl = Utils.CurDomain.OtherSynUrl;
import request from '../common/api/api.js';
const _ajaxOptions = {
    contentType: 'application/json',
    dataType: 'text',
    async: true,
    dataFilter(data, type) {
        return data;
    },
};

export const billTypeStatus = [
    {
        value: 0,
        label: '屠宰销售订单',
    },
    {
        value: 1,
        label: '养殖销售单',
    },
    {
        value: 2,
        label: '物料领用单',
    },
    {
        value: 3,
        label: '死亡记录单',
    },
    {
        value: 4,
        label: '送苗单',
    },
    {
        value: 5,
        label: '代养费结算单',
    },
    {
        value: 6,
        label: '称重单',
    },
    {
        value: 7,
        label: '销售订单',
    },
    {
        value: 8,
        label: '销售出库单',
    },
];
export default class SignTaskApi {
    static addPDFUpload(formFile) {
        return request.postForm(`${OtherSynUrl}/signtasks/uploadFiles`, formFile, { isLoading: true, text: "上传中..." });
    }

    static uploadHtml(formFile) {
        return request.postForm(`${OtherSynUrl}/signtasks/uploadHtmlFiles`, formFile, { isLoading: true, text: "上传中..." });
    }

    // static signTaskCancel(signTaskId, terminationNote) {
    //     return request.post(
    //         `${OtherSynUrl}/signtasks/cancel`,
    //         {
    //             signTaskId,
    //             terminationNote,
    //         },
    //         true,
    //         _ajaxOptions,
    //     );
    // }

    static signTaskAbolish(data) {
        return request.post(`${OtherSynUrl}/signtasks/abolish`, data, { isLoading: true, ajaxOptions: _ajaxOptions });
    }
    static signTaskCancel(data) {
        return request.post(`${OtherSynUrl}/signtasks/cancel`, data, { isLoading: true, ajaxOptions: _ajaxOptions });
    }

    static signTaskUrge(signTaskId) {
        return request.post(
            `${OtherSynUrl}/signtasks/urge`,
            {
                signTaskId,
            },
            { isLoading: true, ajaxOptions: _ajaxOptions }
        );
    }

    static createSomgmTasl(data) {
        return request.post(`${OtherSynUrl}/signtasks/create`, data, { isLoading: true, ajaxOptions: _ajaxOptions });
    }

    static getSignTashDetail(id) {
        return request.get(`${OtherSynUrl}/signtasks/${id}`, { isLoading: true });
    }
    static getSignTashBillNoDetail(billNo) {
        return request.get(`${OtherSynUrl}/signtasks/bybillno/${billNo}`, { isLoading: true });
    }

    static getSignTashList(data) {
        return request.post(`${OtherSynUrl}/signtasks/list`, data, { isLoading: true });
    }

    static getTaskReview(id) {
        return request.get(`${OtherSynUrl}/signtasks/preview/${id}`, { isLoading: true });
    }

    static setTaskPdf(html) {
        return request.post(`${OtherSynUrl}/signtasks/conpdf`, { html });
    }
}
